import request from "@/utils/request";

export default {
  saveCourseInfo(courseInfo) {
    return request({
      url: `/eduservice/edu-course`,
      method: "post",
      data: courseInfo
    });
  },
  getTeacherList() {
    return request({
      url: "/eduservice/teacher/findAll",
      method: "get"
    });
  },
  getNestedChapterList(courseId) {
    return request({
      url: `/eduservice/edu-chapter/nested-list/${courseId}`,
      method: "get"
    });
  },
  getCourseInfoById(id) {
    return request({
      url: `/eduservice/edu-course/${id}`,
      method: "get"
    });
  },
  updateCourseInfoById(courseInfo) {
    return request({
      url: `/eduservice/edu-course/${courseInfo.id}`,
      method: "put",
      data: courseInfo
    });
  },
  getPageList(page, limit, searchObj) {
    return request({
      url: `/eduservice/edu-course/${page}/${limit}`,
      method: "get",
      params: searchObj
    });
  }
};
